package com.zilu.digitaltwin.common.enums;

public enum PropertyTypeEnum {

    STRING("STRING", "STRING"),
    VARCHAR("VARCHAR", "STRING"),

    DOUBLE("DOUBLE", "NUMBER"),

    GEOMETRY("GEOMETRY", "GEOMETRY"),

    INT("INT", "NUMBER"),
    BIGINT("BIGINT", "NUMBER"),

    BOOLEAN("BOOLEAN", "BOOLEAN");

    private final String ddlCode;

    private final String smCode;


    PropertyTypeEnum(String ddlCode, String smCode) {
        this.ddlCode = ddlCode;
        this.smCode = smCode;
    }


    public String getDdlCode() {
        return ddlCode;
    }

    public String getSmCode() {
        return smCode;
    }

    public static String getSmCode(String code) {
        for (PropertyTypeEnum value : PropertyTypeEnum.values()) {
            if (value.getDdlCode().equals(code)) {
                return value.getSmCode();
            }
        }
        return null;
    }

}
